/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aqu.persistencia.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author angelquin
 */
@Entity
@Table(name = "cxp_detalleretencion")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CxpDetalleRetencion.findAll", query = "SELECT c FROM CxpDetalleRetencion c"),
    @NamedQuery(name = "CxpDetalleRetencion.findBycxpCodigoDetRet", query = "SELECT c FROM CxpDetalleRetencion c WHERE c.cxpCodigoDetRet = :cxpCodigoDetRet"),
    @NamedQuery(name = "CxpDetalleRetencion.findBycxpBaseImponibleDetRet", query = "SELECT c FROM CxpDetalleRetencion c WHERE c.cxpBaseImponibleDetRet = :cxpBaseImponibleDetRet"),
    @NamedQuery(name = "CxpDetalleRetencion.findBycxpPorcentajeDetRet", query = "SELECT c FROM CxpDetalleRetencion c WHERE c.cxpPorcentajeDetRet = :cxpPorcentajeDetRet"),
    @NamedQuery(name = "CxpDetalleRetencion.findBycxpValorDetRet", query = "SELECT c FROM CxpDetalleRetencion c WHERE c.cxpValorDetRet = :cxpValorDetRet"),
    @NamedQuery(name = "CxpDetalleRetencion.findBycxpCodigoCabRet", query = "SELECT c FROM CxpDetalleRetencion c WHERE c.cxpCodigoCabRet = :codigoCabRet"),
    @NamedQuery(name = "CxpDetalleRetencion.findBycxpCodigoRet", query = "SELECT c FROM CxpDetalleRetencion c WHERE c.cxpCodigoRet = :CodigoRet"),
    @NamedQuery(name = "CxpDetalleRetencion.findBycxpCodigoImp", query = "SELECT c FROM CxpDetalleRetencion c WHERE c.cxpCodigoImp = :CodigoImp")})
public class CxpDetalleRetencion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "CXP_CODIGO_DETRET")
    private String cxpCodigoDetRet;
    @Column(name = "CXP_BASEIMPONIBLE_DETRET")
    private Double cxpBaseImponibleDetRet;
    @Column(name = "CXP_PORCENTAJE_DETRET")
    private Double cxpPorcentajeDetRet;
    @Column(name = "CXP_VALOR_DETRET")
    private Double cxpValorDetRet;
    @JoinColumn(name = "CXP_CODIGO_CABRET", referencedColumnName = "CXP_CODIGO_CABRET")
    @ManyToOne(optional = false)
    private CxpCabeceraRetencion cxpCodigoCabRet;
    @JoinColumn(name = "CXP_CODIGO_RET", referencedColumnName = "CXP_CODIGO_RET")
    @ManyToOne(optional = false)
    private CxpRetencion cxpCodigoRet;
    @JoinColumn(name = "CXP_CODIGO_IMP", referencedColumnName = "CXP_CODIGO_IMP")
    @ManyToOne(optional = false)
    private CxpImpuesto cxpCodigoImp;

    public CxpDetalleRetencion() {
    }

    public CxpDetalleRetencion(String cxpCodigoDetRet, Double cxpBaseImponibleDetRet, Double cxpPorcentajeDetRet, Double cxpValorDetRet, CxpCabeceraRetencion cxpCodigoCabRet, CxpRetencion cxpCodigoRet, CxpImpuesto cxpCodigoImp) {
        this.cxpCodigoDetRet = cxpCodigoDetRet;
        this.cxpBaseImponibleDetRet = cxpBaseImponibleDetRet;
        this.cxpPorcentajeDetRet = cxpPorcentajeDetRet;
        this.cxpValorDetRet = cxpValorDetRet;
        this.cxpCodigoCabRet = cxpCodigoCabRet;
        this.cxpCodigoRet = cxpCodigoRet;
        this.cxpCodigoImp = cxpCodigoImp;
    }

    public CxpCabeceraRetencion getCxpCodigoCabRet() {
        return cxpCodigoCabRet;
    }

    public void setCxpCodigoCabRet(CxpCabeceraRetencion cxpCodigoCabRet) {
        this.cxpCodigoCabRet = cxpCodigoCabRet;
    }

    public CxpImpuesto getCxpCodigoImp() {
        return cxpCodigoImp;
    }

    public void setCxpCodigoImp(CxpImpuesto cxpCodigoImp) {
        this.cxpCodigoImp = cxpCodigoImp;
    }

    public CxpRetencion getCxpCodigoRet() {
        return cxpCodigoRet;
    }

    public void setCxpCodigoRet(CxpRetencion cxpCodigoRet) {
        this.cxpCodigoRet = cxpCodigoRet;
    }
    
    
    public Double getCxpBaseImponibleDetRet() {
        return cxpBaseImponibleDetRet;
    }

    public void setCxpBaseImponibleDetRet(Double cxpBaseImponibleDetRet) {
        this.cxpBaseImponibleDetRet = cxpBaseImponibleDetRet;
    }
    
    public String getCxpCodigoDetRet() {
        return cxpCodigoDetRet;
    }

    public void setCxpCodigoDetRet(String cxpCodigoDetRet) {
        this.cxpCodigoDetRet = cxpCodigoDetRet;
    }

   public Double getCxpPorcentajeDetRet() {
        return cxpPorcentajeDetRet;
    }

    public void setCxpPorcentajeDetRet(Double cxpPorcentajeDetRet) {
        this.cxpPorcentajeDetRet = cxpPorcentajeDetRet;
    }

    public Double getCxpValorDetRet() {
        return cxpValorDetRet;
    }

    public void setCxpValorDetRet(Double cxpValorDetRet) {
        this.cxpValorDetRet = cxpValorDetRet;
    }

    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cxpCodigoDetRet != null ? cxpCodigoDetRet.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CxpDetalleRetencion)) {
            return false;
        }
        CxpDetalleRetencion other = (CxpDetalleRetencion) object;
        if ((this.cxpCodigoDetRet == null && other.cxpCodigoDetRet != null) || (this.cxpCodigoDetRet != null && !this.cxpCodigoDetRet.equals(other.cxpCodigoDetRet))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "calses.CxpDetalleRetencion[ cxpCodigoDetRet=" + cxpCodigoDetRet + " ]";
    }
    
}
